package com.plian.system.wrapper.hr.hrbackup;

import com.plian.Tools.DateUtil;
import com.plian.system.dto.hr.staff.TrainDTO;
import com.plian.system.dto.hr.staffBackup.TrainOldDTO;
import com.plian.system.entity.hr.staff.Train;
import com.plian.system.entity.hr.staffAnnualBackup.TrainOld;
import com.plian.system.mybatis.support.BaseWrapper;
import com.plian.system.vo.hr.staff.TrainVO;
import com.plian.system.vo.hr.staffAnnualBackup.TrainOldVO;
import com.plian.system.wrapper.util.CacheWrapperUtil;
import com.plian.system.wrapper.util.WrapperUtil;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;

import static com.plian.system.wrapper.util.WrapperConstant.SPRING;

/**
 * 近五年三个月以上培训情况包装类,返回视图层所需的字段
 *
 * @author gangan
 * @since 2019-11-12
 */
@Mapper(componentModel = SPRING, uses = {CacheWrapperUtil.class, WrapperUtil.class})
public interface TrainOldWrapper extends BaseWrapper<TrainOld, TrainOldDTO, TrainOldVO> {

	@Override
	@Mappings(value = {
			@Mapping(source = "startTime", target = "startTimeStr", dateFormat = DateUtil.PATTERN_MONTH),
			@Mapping(source = "endTime", target = "endTimeStr", dateFormat = DateUtil.PATTERN_MONTH)
	})
	TrainOldVO entityToVO(TrainOld entity);
}
